<template>
	<div id='VideoList'>
		<div class="video_list" @click="goAudioList(item)" v-for="item in dataList">
			<div class="list_left">
				<img class="list_img" :src="item.title_img" alt="" />
				<div class="list_mengban"></div>
				<img class="list_icon" src="../../assets/playBtn.png" alt="" />
			</div>
			<div class="list_right">
				<div class="list_title c_text_ellipsis_2">{{item.title}}</div>
				<div v-if="courseFlg||searchFlg" class="list_name">
					<div class="list_name_num">{{item.watch_count}}次播放</div>
					<div v-if="member&&item.member==1" class="list_name_member">会员课程</div>
				</div>
				<div v-else class="list_name">
					<div class="list_name_num">共{{item.video_count}}节</div>
				</div>
			</div>
		</div>
	</div>
</template>

<script>
	export default{
		name:'VideoList',
		props: {
			dataList: {
				default:function(){
					return []
				},
			},
			member:{
				default:false,
			},
			courseFlg:{
				default:true,
			},
			searchFlg:{
				default:false,
			}
			
		},
		components:{
			
		},
		data(){
			return {
				
			}
		},
		created() {
		},
		watch: {
			
		},
		computed: {
			
		},
		mounted(){
			console.log('2',this.dataList)
			document.title=''
		},
		methods:{
			goAudioList(item){
				if(this.courseFlg&&!this.searchFlg){
					this.$router.push({
						name:'courseDetail',
						query:{
							id:item.id
						}
					})
				}else{
					this.$emit('courseClickFlg',item)
				}
					
			}
		}
	}
</script>

<style lang="scss">
	@import './VideoList.scss';
</style>